# 第一阶段：构建阶段
FROM dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:21 AS build
WORKDIR /app
COPY pom.xml .
RUN mvn dependency:go-offline -s /path/to/settings.xml
COPY . .
RUN mvn clean package -DskipTests

# 第二阶段：运行阶段
FROM dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:21
WORKDIR /app
COPY --from=build /app/target/slq.jar /app/slq.jar
EXPOSE 8080
CMD ["java", "-jar", "slq.jar"]